//
// Created by hqd on 2022/3/30.
//

#ifndef LEET_CODE_TABLE_H
#define LEET_CODE_TABLE_H
#define TABLE_DEFAULT_SIZE 10


typedef struct entry {
    int key;
    int val;
    struct entry *next;
} Entry;
typedef struct table {
    Entry **nodes;

    Entry *(*get)(struct table *ht, int key);

    int (*put)(struct table *ht, int key, int val);//定义函数指针
    void (*clear)(struct table *ht);
} HashTable;

Entry *get(HashTable *ht, int key);

HashTable *create();

void clear(HashTable *ht);

int put(HashTable *ht, int key, int val);

unsigned int hash(int key);

#endif //LEET_CODE_TABLE_H
